package com.richmond.gui;

import com.richmond.data.Workday;
import javafx.scene.control.ListCell;
import javafx.scene.input.DataFormat;

import java.text.DateFormat;

/**
 * User: csavard
 * Date: 12-08-07
 * Time: 20:23
 */
public class WordayListCell extends ListCell<Workday> {
	public static final DateFormat DATE_FORMAT = DateFormat.getDateInstance(DateFormat.LONG);
	@Override
	protected void updateItem(Workday workday, boolean b) {
		super.updateItem(workday, b);
		if (workday != null) {
			setText( DATE_FORMAT.format(workday.getDate()) + "	(" + workday.getTimeRecords().size() + ")");
		}
	}
}
